BCMDHD_VERSION = 3.10
BCMDHD_SOURCE = bcmdhd.tar.gz
BCMDHD_SITE = https://android.googlesource.com/kernel/common.git/+archive/bcmdhd-$(BCMDHD_VERSION)/drivers/net/wireless
BCMDHD_STRIP_COMPONENTS = 0
BCMDHD_LICENSE = GPL-2.0

BCMDHD_MODULE_MAKE_OPTS = \
	DRIVER_TYPE=m \
	CONFIG_BCMDHD=m \
	CONFIG_BCMDHD_SDIO=y \
	CONFIG_BCMDHD_SDIO_IRQ=y \
	CONFIG_BCMDHD_OOB=y \
	CONFIG_BCMDHD_USE_STATIC_BUF=y \
	CONFIG_BCMDHD_DTS=y \
	CONFIG_BCMDHD_FW_PATH="/lib/firmware/brcm/fw_bcm43455c0_ag.bin" \
	CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/brcm/brcmfmac43455-sdio.txt" \
	KDIR=$(LINUX_DIR)

LINUX_NEEDS_MODULES = y
BCMDHD_DEPENDENCIES += linux

define BCMDHD_KERNEL_MODULES_BUILD
	cd $(@D) && $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) $(BCMDHD_MODULE_MAKE_OPTS) M=$(@D)
endef
BCMDHD_POST_BUILD_HOOKS += BCMDHD_KERNEL_MODULES_BUILD

define BCMDHD_KERNEL_MODULES_INSTALL
	cd $(@D) && $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) $(BCMDHD_MODULE_MAKE_OPTS) M=$(@D) install
endef
BCMDHD_POST_INSTALL_TARGET_HOOKS += BCMDHD_KERNEL_MODULES_INSTALL

$(eval $(generic-package))
